import * as types from '../constants/ActionTypes';

const initialState = {
  isLoading: true,
  profileAllInfo: {},
  saler: {},
  dealer: {},
};

const profileAllReducer = (state = initialState, action) => {
  switch (action.type) {
    case types.FETCH_PROFILEALL_INFO:
      return { ...state, ...{ isLoading: action.isLoading } };

    case types.RECEIVE_PROFILEALL_INFO:
      return { ...state, ...{ isLoading: false, profileAllInfo: action.ProfileAllInfo } };

    case types.GET_DEALER_INFO:
      return { ...state, ...{ isLoading: false, saler: action.saler, dealer: action.dealer } };

    default:
      return state;
  }
};

export default profileAllReducer;
